﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UnvApi
{
    public class VehicleInfo
    {
        /// <summary>
        /// 车辆授权id，新增时应为空，然后由宇视平台生成
        /// </summary>
        public string? AllowedVehicleID { get; set; }
        public string PlateNo {  get; set; }        //车牌号
        public int VehicleType { get; set;}         //车辆类型：3-小型车，4-大型车（基于宇视平台）
        public int GroupID {  get; set; }           //车辆分组id，通过UnvPmsManager.getVehicleGroups()方法获取
        public string OwnerName {  get; set; }      //车主姓名
        public long LifeSpanStart {  get; set; }    //有效期起始时间戳（秒级），起止均为0则表示永久有效
        public long LifeSpanEnd { get; set; }       //有效期截止时间戳（秒级）
        public string Phone {  get; set; }          //车主电话
        public string OwnerID {  get; set; }        //车主身份证号/工号

        /// <summary>
        /// 创建新的授权车辆信息对象(传入车牌号，使用默认车辆类型3-小型车、默认分组103-其他单位、默认车主姓名匿名)
        /// </summary>
        /// <param name="plateNo">车牌号</param>
        public VehicleInfo(string plateNo)
        {
            PlateNo = plateNo;
            VehicleType = 3;//默认类型3-小型车
            GroupID = 103;//默认分组103-其他单位
            OwnerName = "匿名";
            LifeSpanStart = 0;
            LifeSpanEnd = 0;
            Phone = "";
            OwnerID = "";
        }
        /// <summary>
        /// 创建新的授权车辆信息对象
        /// </summary>
        /// <param name="plateNo">车牌号</param>
        /// <param name="vehicleType">车辆类型</param>
        /// <param name="groupId">车辆分组id，通过getVehicleGroups()方法获取</param>
        /// <param name="ownerName">车主姓名</param>
        /// <param name="lifeSpanStart">有效期起始秒级时间戳</param>
        /// <param name="lifeSpanEnd">有效期截止秒级时间戳</param>
        public VehicleInfo(string plateNo, int vehicleType, int groupId, string ownerName, long lifeSpanStart, long lifeSpanEnd)
        {
            PlateNo = plateNo;
            VehicleType = vehicleType;
            GroupID = groupId;
            OwnerName = ownerName;
            LifeSpanStart = lifeSpanStart;
            LifeSpanEnd = lifeSpanEnd;
            Phone = "";
            OwnerID = "";
        }
        /// <summary>
        /// 创建新的授权车辆信息对象
        /// </summary>
        /// <param name="plateNo">车牌号</param>
        /// <param name="vehicleType">车辆类型</param>
        /// <param name="groupId">车辆分组id，通过getVehicleGroups()方法获取</param>
        /// <param name="ownerName">车主姓名</param>
        /// <param name="lifeSpanStart">有效期起始秒级时间戳</param>
        /// <param name="lifeSpanEnd">有效期截止秒级时间戳</param>
        /// <param name="phone">车主电话号码</param>
        /// <param name="ownerId">车主身份证号（工号）</param>
        public VehicleInfo(string plateNo, int vehicleType, int groupId, string ownerName, long lifeSpanStart, long lifeSpanEnd, string phone, string ownerId)
        {
            PlateNo = plateNo;
            VehicleType = vehicleType;
            GroupID = groupId;
            OwnerName = ownerName;
            LifeSpanStart = lifeSpanStart;
            LifeSpanEnd = lifeSpanEnd;
            Phone = phone;
            OwnerID = ownerId;
        }

    }
}
